package com.yanqu.road.entity.activity.xiuxian.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.property.Property;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_xiuxian_data")
public class XiuXianUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "玩家ID", select = true)
    private long userId;

    @FieldTypeAnnotation(desc = "境界id", update = true)
    private int stateId;

    @FieldTypeAnnotation(desc = "虚空鼎等级", update = true)
    private int tripodLv;

    @FieldTypeAnnotation(desc = "虚空鼎经验", update = true)
    private int tripodExp;

    @FieldTypeAnnotation(desc = "虚空鼎内装备", update = true)
    private XiuXianEquipmentData tripodEquipment = new XiuXianEquipmentData();

    @FieldTypeAnnotation(desc = "仙力值", update = true)
    private long powerVal;

    @FieldTypeAnnotation(desc = "最高仙力值", update = true)
    private long maxPowerVal;

    @FieldTypeAnnotation(desc = "怒气值", update = true)
    private int angerVal;

    @FieldTypeAnnotation(desc = "修为值", update = true)
    private long practiceVal;

    @FieldTypeAnnotation(desc = "修为产速", update = true)
    private int practiceSpeed;

    @FieldTypeAnnotation(desc = "渡劫次数", update = true)
    private int breakCount;

    @FieldTypeAnnotation(desc = "体力", update = true)
    private int energy;

    @FieldTypeAnnotation(desc = "上一次渡劫失败时间", update = true)
    private long lastBreakFailTime;

    @FieldTypeAnnotation(desc = "上次恢复时间", update = true)
    private long lastEnergyRecTime;

    @FieldTypeAnnotation(desc = "使用体力次数", update = true)
    private int energyUseCount;

    @FieldTypeAnnotation(desc = "使用体力总数量", update = true)
    private int totalUseEnergy;

    @FieldTypeAnnotation(desc = "机缘点数量", update = true)
    private int luckPoint;

    @FieldTypeAnnotation(desc = "未领取机缘点数量", update = true)
    private int unreceivedLuckPoint;

    @FieldTypeAnnotation(desc = "上次挂机结算时间", update = true)
    private long lastMeditateTime;

    @FieldTypeAnnotation(desc = "法宝数据")
    private Map<Integer, XiuXianEquipmentData> equipmentMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "玩家属性")
    private XiuXianPveUserProperty property = new XiuXianPveUserProperty();

    @FieldTypeAnnotation(desc = "宗门id", update = true)
    private int sectId;

    @FieldTypeAnnotation(desc = "宗门灵峰id", update = true)
    private int mountId;

    @FieldTypeAnnotation(desc = "形象id", update = true)
    private int imageId;

    @FieldTypeAnnotation(desc = "所有材料")
    private Property items = new Property();

    @FieldTypeAnnotation(desc = "已结算pvp轮次")
    private int pvpEndRound;

    @FieldTypeAnnotation(desc = "累计抽取法宝次数")
    private long drawTimes;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public XiuXianPveUserProperty getProperty() {
        return property;
    }

    public void setProperty(XiuXianPveUserProperty property) {
        if (null == property) {
            return;
        }
        this.property = property;
        setOp(DataStatus.Update);
    }

    public int getTripodLv() {
        return tripodLv;
    }
    public void setTripodLv(int tripodLv) {
        if (this.tripodLv != tripodLv) {
            this.tripodLv = tripodLv;
            setOp(DataStatus.Update);
        }
    }

    public long getPowerVal() {
        return powerVal;
    }
    public void setPowerVal(long powerVal) {
        if (this.powerVal != powerVal) {
            this.powerVal = powerVal;
            setOp(DataStatus.Update);
        }
    }

    public int getAngerVal() {
        return angerVal;
    }
    public void setAngerVal(int angerVal) {
        if (this.angerVal != angerVal) {
            this.angerVal = angerVal;
            setOp(DataStatus.Update);
        }
    }

    public long getPracticeVal() {
        return practiceVal;
    }
    public void setPracticeVal(long practiceVal) {
        if (this.practiceVal != practiceVal) {
            this.practiceVal = practiceVal;
            setOp(DataStatus.Update);
        }
    }

    public int getPracticeSpeed() {
        return practiceSpeed;
    }
    public void setPracticeSpeed(int practiceSpeed) {
        if (this.practiceSpeed != practiceSpeed) {
            this.practiceSpeed = practiceSpeed;
            setOp(DataStatus.Update);
        }
    }

    public int getBreakCount() {
        return breakCount;
    }
    public void setBreakCount(int breakCount) {
        if (this.breakCount != breakCount) {
            this.breakCount = breakCount;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }
    public void setEnergy(int energy) {
        if (this.energy != energy) {
            this.energy = energy;
            setOp(DataStatus.Update);
        }
    }

    public long getLastBreakFailTime() {
        return lastBreakFailTime;
    }
    public void setLastBreakFailTime(long lastBreakFailTime) {
        if (this.lastBreakFailTime != lastBreakFailTime) {
            this.lastBreakFailTime = lastBreakFailTime;
            setOp(DataStatus.Update);
        }
    }

    public long getLastEnergyRecTime() {
        return lastEnergyRecTime;
    }
    public void setLastEnergyRecTime(long lastEnergyRecTime) {
        if (this.lastEnergyRecTime != lastEnergyRecTime) {
            this.lastEnergyRecTime = lastEnergyRecTime;
            setOp(DataStatus.Update);
        }
    }

    public long getLastMeditateTime() {
        return lastMeditateTime;
    }
    public void setLastMeditateTime(long lastMeditateTime) {
        if (this.lastMeditateTime != lastMeditateTime) {
            this.lastMeditateTime = lastMeditateTime;
            setOp(DataStatus.Update);
        }
    }

    public int getStateId() {
        return stateId;
    }

    public void setStateId(int stateId) {
        if (this.stateId != stateId) {
            this.stateId = stateId;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, XiuXianEquipmentData> getEquipmentMap() {
        return equipmentMap;
    }

    public void setEquipmentMap(Map<Integer, XiuXianEquipmentData> equipmentMap) {
        if (equipmentMap == null) {
            return;
        }
        this.equipmentMap = equipmentMap;
        setUpdateOption();
    }

    public int getSectId() {
        return sectId;
    }

    public void setSectId(int sectId) {
        if (this.sectId != sectId) {
            this.sectId = sectId;
            setOp(DataStatus.Update);
        }
    }

    public int getMountId() {
        return mountId;
    }

    public void setMountId(int mountId) {
        if (this.mountId != mountId) {
            this.mountId = mountId;
            setOp(DataStatus.Update);
        }
    }

    public int getImageId() {
        return imageId;
    }

    public void setImageId(int imageId) {
        if (this.imageId != imageId) {
            this.imageId = imageId;
            setOp(DataStatus.Update);
        }
    }

    public XiuXianEquipmentData getTripodEquipment() {
        return tripodEquipment;
    }

    public void setTripodEquipment(XiuXianEquipmentData tripodEquipment) {
        if (null == tripodEquipment) {
            return;
        }
        this.tripodEquipment = tripodEquipment;
        setOp(DataStatus.Update);
    }

    public int getEnergyUseCount() {
        return energyUseCount;
    }

    public void setEnergyUseCount(int energyUserCount) {
        if (this.energyUseCount != energyUserCount) {
            this.energyUseCount = energyUserCount;
            setOp(DataStatus.Update);
        }
    }

    public int getLuckPoint() {
        return luckPoint;
    }

    public void setLuckPoint(int luckPoint) {
        if (this.luckPoint != luckPoint) {
            this.luckPoint = luckPoint;
            setOp(DataStatus.Update);
        }
    }

    public int getPvpEndRound() {
        return pvpEndRound;
    }

    public void setPvpEndRound(int pvpEndRound) {
        if (this.pvpEndRound != pvpEndRound) {
            this.pvpEndRound = pvpEndRound;
            setOp(DataStatus.Update);
        }
    }

    public int getUnreceivedLuckPoint() {
        return unreceivedLuckPoint;
    }

    public void setUnreceivedLuckPoint(int unreceivedLuckPoint) {
        if (this.unreceivedLuckPoint != unreceivedLuckPoint) {
            this.unreceivedLuckPoint = unreceivedLuckPoint;
            setOp(DataStatus.Update);
        }
    }

    public int getTripodExp() {
        return tripodExp;
    }

    public void setTripodExp(int tripodExp) {
        if (this.tripodExp != tripodExp) {
            this.tripodExp = tripodExp;
            setOp(DataStatus.Update);
        }
    }

    public long getMaxPowerVal() {
        return maxPowerVal;
    }

    public void setMaxPowerVal(long maxPowerVal) {
        if (this.maxPowerVal != maxPowerVal) {
            this.maxPowerVal = maxPowerVal;
            setOp(DataStatus.Update);
        }
    }

    public int getTotalUseEnergy() {
        return totalUseEnergy;
    }

    public void setTotalUseEnergy(int totalUseEnergy) {
        if (this.totalUseEnergy != totalUseEnergy) {
            this.totalUseEnergy = totalUseEnergy;
            setOp(DataStatus.Update);
        }
    }

    public Property getItems() {
        return items;
    }

    public void setItems(Property items) {
        if (null == items) {
            return;
        }
        this.items = items;
        setOp(DataStatus.Update);
    }

    public long getDrawTimes() {
        return drawTimes;
    }

    public void setDrawTimes(long drawTimes) {
        if (this.drawTimes != drawTimes) {
            this.drawTimes = drawTimes;
            setOp(DataStatus.Update);
        }
    }
}
